//
//  MTQuestionVC.m
//  met
//
//  Created by 李晓俊 on 2019/5/9.
//  Copyright © 2019 李晓俊. All rights reserved.
//

#import "MTQuestionVC.h"
#import "MTQuestionCell.h"
@interface MTQuestionVC ()
@property (nonatomic,strong) NSMutableArray *dataArr;
@end

@implementation MTQuestionVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = self.name;
    [self setupTableView:UITableViewStyleGrouped header:NO footer:NO];
    [self.tableView setFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight-85-BottomHeight)];

    self.tableView.tableFooterView = [UIView new];
    self.tableView.backgroundColor = KBackColor;
//    self.tableView.separatorColor=[UIColor clearColor];
    self.dataArr = [NSMutableArray new];
    [self setbottomBut];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}
- (void)setbottomBut {
    UIView *bg = [UIView new];
    [self.view addSubview:bg];
    [bg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.bottom.mas_equalTo(-BottomHeight);
        make.height.mas_equalTo(85);
    }];
    
    UIButton *done = [UIButton new];
    [done setTitle:@"修改" forState:UIControlStateNormal];
    [bg addSubview:done];
    [done mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(18);
        make.right.mas_equalTo(-18);
        make.height.mas_equalTo(60);
        make.top.mas_equalTo(5);
    }];
    done.titleLabel.font = CLRudeCircleTextFont(26);
    [done setTitleColor:KBlackColor forState:UIControlStateNormal];
    [done setBackgroundColor:HEXCOLOR(0x52C5FE)];
    done.layer.masksToBounds = YES;
    done.layer.cornerRadius = 4.0f;
    [done addTarget:self action:@selector(doneClick) forControlEvents:UIControlEventTouchUpInside];
    
    done.layer.borderWidth = 2;
    done.layer.borderColor = KBlackColor.CGColor;
}
//完成点击了
- (void)doneClick {
    
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 75.0f;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MTQuestionCell *cell = [MTQuestionCell cellWithTableView:tableView];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 36.0f;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView *v = [UIView new];
    v.backgroundColor = KBackColor;
    UILabel *la = [UILabel new];
    [v addSubview:la];
    [la mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(16);
        make.centerY.mas_equalTo(0);
        make.width.mas_equalTo(160);
        make.height.mas_equalTo(18);
    }];
    la.font = FONT(16);
    la.textColor = TextTiTleColor;
    if (section == 0) {
        la.text = @"通关的人：";
    }else {
        la.text = @"答错的人：";
    }
    return v;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.01f;
}

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    UIView *view = [UIView new];
    return view;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  
}
//补全tableview的线
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{\
    cell.separatorInset = UIEdgeInsetsZero;\
    cell.layoutMargins = UIEdgeInsetsZero; \
    cell.preservesSuperviewLayoutMargins = NO; \
}
@end
